package com.tiger.cloud.controller.activity;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tiger.cloud.common.mybatis.BaseController;
import com.tiger.cloud.filter.IgnoreAuth;
import com.tiger.cloud.model.activity.Activity;
import com.tiger.cloud.service.activity.IActivityService;
import com.tiger.cloud.util.Response;
import com.tiger.cloud.util.ResponseUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * activity活动
 */
@Controller
@RequestMapping(value = "activity")
@Api(value = "活动接口",tags = "活动列表")
public class ActivityController extends BaseController {

	private static final Logger logger=Logger.getLogger(ActivityController.class);
	
	@Autowired
	private IActivityService activityService;
	
	@RequestMapping(value = "find", method = RequestMethod.POST)
	@ResponseBody
	@IgnoreAuth
	@CrossOrigin
	@ApiOperation(value = "获取活动列表", notes = "获取活动列表")
	public Response find() throws Exception {
		List<Activity> result = activityService.findActivity();
		return ResponseUtil.ok(result);
	}
	
	
//	@RequestMapping(value = "update", method = RequestMethod.POST)
//	@ResponseBody
//	public Response update(@CurrentUserId Long userId,HttpServletRequest request,@RequestBody  Activity activity){
//		activityService.update(activity);
//		return ResponseUtil.ok();
//	}
//
//	@RequestMapping(value = "add", method = RequestMethod.POST)
//	@ResponseBody
//	public Response add(@CurrentUserId Long userId,HttpServletRequest request,@RequestBody  Activity activity){
//		activityService.insert(activity);
//		return ResponseUtil.ok();
//	}

	

}